package com.zzyl.nursing.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class AlertProcessingDTO {

    private Integer id;
    private String processingResult;
    private LocalDateTime processingTime;

    // Getter and Setter methods

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getProcessingResult() {
        return processingResult;
    }

    public void setProcessingResult(String processingResult) {
        this.processingResult = processingResult;
    }

    public LocalDateTime getProcessingTime() {
        return processingTime;
    }

    public void setProcessingTime(LocalDateTime processingTime) {
        this.processingTime = processingTime;
    }

    // Additional method to parse the date string into LocalDateTime
    public void setProcessingTimeString(String processingTimeString) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        this.processingTime = LocalDateTime.parse(processingTimeString, formatter);
    }

    @Override
    public String toString() {
        return "AlertProcessingDTO{" +
                "id=" + id +
                ", processingResult='" + processingResult + '\'' +
                ", processingTime=" + processingTime +
                '}';
    }
}